package card;

import place.Landindex;
import PJ.Entrance;
import PJ.Player;

public class FortuneGodCard extends CardSystem {
	//福神卡
	String name="FortuneGodCard";
	String function="使用时立即获得一张卡片（包括非售卡），八回合内经过别人土地不用支付过路费";	
	String type="MagicCard";
	String range="自己";
	FortuneGodCard(){
		int point=30;
		this.point=point;
	}	
	@Override
	public int getPoint() {
		return point;
	}
	@Override
	public String getName() {
		
		return name;
	}

	@Override
	public String getFunction() {
		// TODO Auto-generated method stub
		return function;
	}

	@Override
	public String getType() {
		// TODO Auto-generated method stub
		return type;
}

	@Override
	public String getRange() {
		// TODO Auto-generated method stub
		return range;
	}
	@Override
	public void print(int location, int namei) {
		// TODO Auto-generated method stub
		Player player=new Player();
		int[] cards;
		for(int i=0;i<Entrance.players.size();i++){
			if(Entrance.players.get(i).getNamei()==namei){
				player=Entrance.players.get(i);
			}
		}
		int i=(int)(Math.random()*17);
		cards=player.getCards();
		cards[i]++;
		System.out.println("真受到福神保佑，您得到了"+CardSystem.cardsystem[i].getName()+"一张，而且八个回合内您可以免费住宿");
		player.setSpecial(16);
	}
}

